home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
-seriously_amiga-
/
shareware
/
programming
/
blitz
/
changelibnum
/
source
/
changelibnum.asc
Wrap
Text File
|
1997-12-01
|
852b
|
44 lines
;A small program to change blitz library numbers
;Do whatever you want with this source
usagetext$="Usage: Chlibnum <library name> <library number>"
;check if there were any parameters passed
pars.w=NumPars
;print usage info and exit
If pars<2 Then NPrint usagetext$:End
;find the parameters
filename$=Par$(1)
libnum.w=Val(Par$(2))
If filename$="?" Then NPrint usagetext$:End
errortext$="Can't open file "+"'"+filename$+"'"
;try to open the library
If Exists(filename$)
If OpenFile(0,filename$)
FileOutput 0
FileSeek 0,37 ;jump to the right position in the file
Print Chr$(libnum) ;print the number
DefaultOutput
CloseFile 0
Else
NPrint errortext$:End
EndIf
Else
NPrint errortext$:End
EndIf
NPrint "The new library number is "+Str$(libnum)
End